<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\Route;
Route::group('api',function(){

    Route::get('wx','api/login/wxAuthor');

    // +----------------------------------------------------------------------
    // | 收货地址
    // +----------------------------------------------------------------------
    Route::group('address',function(){
        Route::post('detail','api/address/detail');//收货地址详情
        Route::post('list','api/address/address_list');//收货地址列
        Route::post('default','api/address/setdefault');//设置默认收货地址
        Route::post('del','api/address/del');//删除收货地址
        Route::post('edit','api/address/edit');//添加(修改)收货地址
    });

      // +----------------------------------------------------------------------
    // | 登录注册
    // +----------------------------------------------------------------------
    Route::group('member',function(){
        Route::post('login','api/login/login');                                 //登录
        Route::post('register','api/login/register');                           //注册
        Route::post('message','api/msn/index');                                 //发送验证码
        Route::post('bind','api/login/bind');                                   //换手机号
    });

    // +----------------------------------------------------------------------
    // | 购物车
    // +----------------------------------------------------------------------
    Route::group('cart',function(){
        Route::post('add','api/cart/add');//添加购物车
        Route::post('update','api/cart/update');//更新购物车数量，规格
        Route::post('remove','api/cart/remove');//删除购物车
        Route::post('select','api/cart/select');//选择要下单支付的产品
        Route::post('','api/cart/index');//购物车列表
    });

    // +----------------------------------------------------------------------
    // | 商品
    // +----------------------------------------------------------------------
    Route::group('goods',function(){
        Route::get('','api/goods/index');//商品列表
        Route::get('category','api/goods/category');//分类
        Route::get('detail','api/goods/detail');//商品详情
        Route::get('spec','api/goods/spec');//规格列表
        Route::get('search_goods','api/goods/search_goods');//搜索商品
    });

    // +----------------------------------------------------------------------
    // | 订单
    // +----------------------------------------------------------------------
    Route::group('order',function(){
        Route::post('','api/order/index');//订单列表
        Route::post('place','api/order/placeOrder'); //提交订单
        Route::post('pre','api/order/preOrder'); //获取预订单信息
        Route::post('detail','api/order/detail');//获取订单详情
        Route::post('cancel','api/order/cancel');//取消订单
        Route::post('receive','api/order/receive');//确认收货
        Route::post('refund','api/order/refund');//退款
        Route::post('express','api/order/express');//快递信息
        Route::post('pay_sn','api/order/order_pay_sn');//订单再次购买
    });

    // +----------------------------------------------------------------------
    // | 我的
    // +----------------------------------------------------------------------
    Route::group('personal',function(){
        Route::post('personal_center','api/personal/personal_center'); //个人中心
        Route::group('coupon',function (){
            Route::post('','api/personal/coupon_list');//我的优惠卷
            Route::post('center','api/personal/system_coupon');//系统生成优惠卷
            Route::post('receive','api/personal/get_coupon');//领取优惠卷
        });
        Route::post('changeInformation','api/personal/changeInformation');//修改资料
        Route::post('userInfomation','api/personal/userInfomation');//查询资料
        Route::post('bind','api/personal/bind');//绑定第三方
    });

    // +----------------------------------------------------------------------
    // | 支付
    // +----------------------------------------------------------------------
    Route::group('pay',function(){
        Route::group('wechat',function(){
            Route::post('','api/pay/create');//微信支付
            Route::post('notify','api/pay/notify');//微信回调
            Route::post('refund/notify','api/pay/refund_return');//微信回调
        });
    });

	

    // +----------------------------------------------------------------------
    // | 首页
    // +----------------------------------------------------------------------
    Route::group('index',function(){
        Route::get('ad','api/Index/ad');//推广
        Route::get('ad_detail','api/Index/ad_detail');//推广
        Route::get('banner','api/Index/banner');//轮播图
    });

    // +----------------------------------------------------------------------
    // | 发短信
    // +----------------------------------------------------------------------
    Route::group('Msns',function (){
        Route::post('','api/Msns/index');//注册验证码
    });


});
